package com.sky.anotion;
/**
 * 校验参数id的注解
 */

import com.sky.anotion.validator.PositiveIdValidator;
import com.sky.anotion.validator.UpdateGroup;
import com.sky.enumeration.ValidIdType;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

@Documented
@Constraint(validatedBy = {PositiveIdValidator.class})
@Target( {ElementType.PARAMETER, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface ValidId {

    String message() default "Id为空或类型错误！";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    boolean required() default true;

    /**
     * 指定要校验的目标类型
     */
//    Type value() default Type.LONG;\
    ValidIdType value() default ValidIdType.STRING;
}
